/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.loja.model.entity.transacao.impl;

import javax.persistence.Entity;
import br.com.loja.model.entity.compra.Compra;
import br.com.loja.model.entity.despesa.CartaoCreditoCompra;
import br.com.loja.model.entity.transacao.PagamentoCompra;

/**
 *
 * @author David Luiz
 */
@Entity
public class PagamentoCompraCartao extends PagamentoCompra {
    
    public PagamentoCompraCartao() {
        super();
    }
    
    public PagamentoCompraCartao(Compra compra, CartaoCreditoCompra cartaoCreditoCompra) {
        super(compra);
        if (cartaoCreditoCompra == null) {
            throw new IllegalArgumentException("Cartao de Credito invalido");
        }
        setRemetente(cartaoCreditoCompra.getConta());
        setHistorico("COMPRA EM" + compra.getFornecedor().toUpperCase());
    }
    
}
